package com.smartleanx.module.hrm.controller.admin.esign;

import com.github.pagehelper.PageInfo;
import com.smartleanx.framework.common.pojo.CommonResult;
import com.smartleanx.framework.tenant.core.aop.TenantIgnore;
import com.smartleanx.module.hrm.service.esign.EsignSealContractInfo;
import com.smartleanx.module.hrm.service.esign.auth.ElecSealService;
import com.smartleanx.module.hrm.service.esign.vo.OrgSealSelectVo;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;

@Api(tags = "印章管理")
@RestController
@RequestMapping("/hrm/elec/Seal")
public class ElecSealController {

    @Autowired
    private ElecSealService elecSealService;
    @GetMapping("/selectSealInfo")

    public CommonResult<Object> selectSealInfo(@RequestParam("corpId") Integer corpId) {
        OrgSealSelectVo orgSealSelectVo = elecSealService.selectSealInfo(corpId);
        return CommonResult.success(orgSealSelectVo);
    }


    @GetMapping("/selectPage")
    private CommonResult<Object> selectPage(@RequestParam("pageNum") Integer pageNum,
                                            @RequestParam("pageSize") Integer pageSize,
                                            @RequestParam("sealId") String sealId,
                                            @RequestParam(value = "signTImeStart",required = false) String signTImeStart,
                                            @RequestParam(value = "signTimeEnd",required = false) String signTimeEnd,
                                            @RequestParam(value = "signName",required = false) String signName) {
        PageInfo<EsignSealContractInfo> objectPageInfo = elecSealService.selectPage(pageNum, pageSize, sealId, signTImeStart, signTimeEnd, signName);
        return CommonResult.success(objectPageInfo);
    }


}
